//引入vue
import Vue from "vue"
//必须实例化
var vm = new Vue()

const http = uni.$u.http
const install = (Vue, vm) => {

	// post请求，获取菜单
	let postMenu = (params, config = {}) => http.post('/ebapi/public_api/index', params, config)

	// get请求，获取菜单，注意：get请求的配置等，都在第二个参数中，详见前面解释
	let getMenu = (data) => http.get('/ebapi/public_api/index', data)


	//登录
	let login = (data) => http.get(`/wx/user/${vm.$appid}/login`, data)
	//授权
	let auth = (params) => http.post(`/wx/user/${vm.$appid}/postAuth`, params)
	vm.$u.api = {
		login,
		auth
	};
}
export default {
	install
}
